<?php
class DrugsController extends AppController{
	function insert($data){
		$this->data['Drug']['claimid']=$data[0];
		$this->data['Drug']['generic_name']=$data[1];
		$this->data['Drug']['brand_name']=$data[2];
		$this->data['Drug']['preparation']=$data[3];
		$this->data['Drug']['quantity']=$data[4];
		$this->data['Drug']['unit_price']=str_replace(',', '', $data[5]);
		$this->data['Drug']['actual_charge']=str_replace(',', '', $data[6]);
		$this->data['Drug']['claim_hospital']=str_replace(',', '', $data[7]);
		$this->data['Drug']['claim_patient']=str_replace(',', '', $data[8]);
		$this->data['Drug']['status']=1;
		
		$this->Drug->create();
		$this->Drug->save($this->data);
	}
	function setStatus($id, $status){
		$this->data['Drug']['id']=$id;
		$this->data['Drug']['status']=$status;
		
		$this->Drug->save($this->data);
	}
}
?>